# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-prometheus_client
pkgver=0.16.0
pkgrel=2

pkgdesc="Prometheus instrumentation library for Python applications"
url="https://github.com/prometheus/client_python"
arch=('any')
license=('APACHE')

depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-twisted' 'python-pytest')

source=(client_python-$pkgver.tar.gz::https://github.com/prometheus/client_python/archive/v${pkgver}.tar.gz)

sha512sums=('511936758026b6d6f48f52d27b1cb964a03668054d7a3c5c82c4fa20800be3812150fca74ab46dad11ca12f2c9ce1a6951a82ae2bacf91b3761f7bf7ce75e0d2')

build() {
  cd client_python-$pkgver
  python setup.py build
}

check() {
  cd client_python-$pkgver
  # Make reproducible by not writing pyc files for test files. (rebuilderd does not run tests)
  PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -vs .
}

package() {
  cd client_python-$pkgver
  python setup.py install --root="$pkgdir" --skip-build --optimize=1
}
